
package com.karrim.client.mvp;

import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;
import com.gwtplatform.mvp.client.proxy.PlaceManagerImpl;
import com.gwtplatform.mvp.client.proxy.PlaceRequest;
import com.gwtplatform.mvp.client.proxy.TokenFormatter;
import com.karrim.client.mvp.annotation.DefaultPlace;

/**
 *
 * @author andrea.cantafio
 */
public class DefaultPlaceManager extends PlaceManagerImpl {

    @Inject
    public DefaultPlaceManager(EventBus eventBus, TokenFormatter tokenFormatter, @DefaultPlace String defaultNameToken) {
        super(eventBus, tokenFormatter);
        
        defaultPlaceRequest = new PlaceRequest(defaultNameToken);
    }
    
    
    public void revealDefaultPlace() {
        revealPlace(defaultPlaceRequest, false);   // With false, avoids re-redirection when user press back button 
    }
    
    private PlaceRequest defaultPlaceRequest;
}
